Release 10.1A: OpenEdge Development:
Progress 4GL Reference
DESTRUCTOR statement
Defines a destructor method for a class. Progress invokes this destructor method when the object is deleted using the DELETE OBJECT statement.
Note: This statement is applicable only when used in a class definition (.cls) file.Syntax
PUBLICSpecifies the access mode for this destructor method. The access mode for a destructor method is always PUBLIC.
A PUBLIC destructor method can be accessed indirectly by the defining class, any of its inheriting classes, and any class or procedure that instantiates the class object (that is, through an object reference) by deleting the object instance using the DELETE OBJECT statement.
class-nameThe name of the class this method destroys. This name must match the class name portion of the type name for the class (that is, the name of the class definition file excluding the
.clsextension and any package path information).destructor-bodyThe body of the destructor definition. Define the destructor body using the following syntax:
method-logicThe logic of the destructor method, which can contain any Progress 4GL statements currently allowed within a PROCEDURE block including class-related statements, but excluding the RETURN ERROR statement. The method’s logic must not reference, either directly or indirectly, statements that block I/O (namely, the CHOOSE, INSERT, PROMPT-FOR, READKEY, SET, UPDATE, and WAIT-FOR statements).
This method typically contains logic to release system resources used by the class object instance.
END [ DESTRUCTOR ]Specifies the end of the destructor body definition. You must end the destructor body definition with the END statement.
ExampleThe following example shows the definition of a destructor method:
Notes
- You can terminate a DESTRUCTOR statement with either a period (.) or a colon (:).
- A complete destructor method definition must begin with the DESTRUCTOR statement and end with the END statement.
- A destructor method has no parameters and no return value.
- You never explicitly invoke the destructor method to delete a class object instance. The method is implicitly invoked when the object instance is destroyed by the DELETE OBJECT statement.
See also
CLASS statement, CONSTRUCTOR statement, DELETE OBJECT statement
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |